package com.liuyandog.server;



import com.liuyandog.pojo.Administrator;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class AdminWelcomeServer extends JPanel {
    private  Font font=new Font("宋体", Font.BOLD, 20);
    public AdminWelcomeServer(Administrator a) throws HeadlessException {

                this.setLayout(null);
                JPanel welcomePanel=new JPanel();
                welcomePanel.setLayout(new FlowLayout(FlowLayout.CENTER));
                Font welcomeFont=new Font("等线",Font.PLAIN+Font.CENTER_BASELINE,45);
                welcomePanel.setSize(500,100);
                welcomePanel.setLocation(100,0);
                JLabel welcomeLabel1=new JLabel("尊敬的管理员:"+a.name);
                welcomeLabel1.setSize(200,60);
                welcomeLabel1.setFont(welcomeFont);
                welcomePanel.add(welcomeLabel1);
                //d第1行


                JButton over= new JButton("退出");
                over.setFont(font);
                over.setBounds(250,300,150,30);
                over.addActionListener(new ActionListener() {
                     @Override
                     public void actionPerformed(ActionEvent e) {
                         System.exit(0);
                     }
                 });
                //welcomePanel.setBackground(Color.RED);
                add(welcomePanel);
                add(over);





    }
}
